﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HS.Domain.EF;
using System.Data.Entity;

namespace HS.Business.Security
{    
    public class Security
    {
       HomeSolutionsDBEntities context = new HomeSolutionsDBEntities();
       public Usuario authenticate(string login, string password)
       {
           return context.Usuario
                    .Include(p => p.Rol)
                    .Include(p => p.Rol.MenuOpciones)
                    .Where(p => p.Login == login & p.Password == password)
                    .FirstOrDefault();
       }
    }
}
